package com.orangelife.mobile.main.view;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.TextView;

import com.common.sp.CommSp2;
import com.common.sp.OtherSp;
import com.common.sp.UserSp;
import com.curry.orangelife.mobile.R;
import com.orangelife.mobile.util.LogE;
import com.orangelife.mobile.app.application.CurryApplication;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 排行版
 * <p/>
 * Created by 绯若虚无 on 2016/1/6.
 */
public class RedEnvelopeRankActivity extends Activity {
    @Bind(R.id.webView)
    WebView webView;
    @Bind(R.id.tv_title)
    TextView tvTitle;

    @SuppressLint("SetJavaScriptEnabled")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_red_envelope_rank);
        ButterKnife.bind(this);
        String loginID = UserSp.getLoginID();
        String commID = CommSp2.getCommID();
        String redEnvelopeID = OtherSp.getRedEnvelopeID();
        String url = CurryApplication.getInstance().getServerURL() + "/orangelife_web/views/share/leaderboard.html?redenvID=" + redEnvelopeID + "&userID=" + loginID + "&commID=" + commID;
        LogE.E(url);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl(url);
        tvTitle.setText("排行榜");
    }

    public void onBackClick(View v) {
        super.onBackPressed();
    }
}
